#ifndef LV_PORTING_H
#define LV_PORITNG_H

#include "Arduino.h"
#include "lvgl/lvgl.h"
#include "epd2in9.h"
#include "epdpaint.h"

#if ARDUINO_USB_CDC_ON_BOOT==1
#define Serial Serial0
#endif

#define DISP_HOR_RES EPD_HEIGHT
#define DISP_VER_RES EPD_WIDTH

#define COLORED     0
#define UNCOLORED   1

#define PARTICAL 1
#define FULL 0
class LV_DISPLAY
{
private:
    /* data */
    int8_t _scl;
    int8_t _sda;
    int8_t _rst;
    int8_t _dc;
    int8_t _cs;
    int8_t _busy;
public:
    LV_DISPLAY(int8_t scl=16,int8_t sda=17,int8_t rst=18,int8_t dc=12,int8_t cs=13,int8_t busy=14);
    int8_t begin();
    void refresh(uint8_t Mode);
};

extern LV_DISPLAY EPD;

int8_t lv_hal_init();

#endif